<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>

<link rel="stylesheet" type="text/css" href="/css/report.css"/>
<script type="text/javascript" src="/js/consult.js"></script>
<script type="text/javascript">
	function move(){
		$("#consultList").attr('action','/consult/consultList.desk').submit();
	}
</script>
<s:url id="listURLPrev" value="/consult/consultList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber - 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
	<s:param name="searchKeyword">
		<s:property value="searchKeyword"/>
	</s:param>
	<s:param name="searchOption">
		<s:property value="searchOption"/>
	</s:param>
</s:url>

<s:url id="listURLNext" value="/consult/consultList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber + 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
	<s:param name="searchKeyword">
		<s:property value="searchKeyword"/>
	</s:param>
	<s:param name="searchOption">
		<s:property value="searchOption"/>
	</s:param>
</s:url>

<s:set name="authCode" value="#session.authCode"/>
<s:set name="orgCode" value="#session.orgCode"/>
<s:set name="totalCount" value="%{pageInfoDataMap.totalCount}"/>

<form name="consultList" id="consultList" method="post">
<input type="hidden" name="deskCodeForExcel" value="<s:property value="#session.deskCode"/>"/>
<input type="hidden" name="userSeq" value="<s:property value="#session.userSeq"/>"/>
<input type="hidden" name="authCode" value="<s:property value="#session.authCode"/>"/>
<input type="hidden" name="orgCode" value="<s:property value="#session.orgCode"/>"/>
<input type="hidden" name="reportGubun" value="consult"/>

	 <!-- 오른쪽 내용 시작 -->
      <dl class="Right_Contents_area">
        <dd class="Center_Top_title"> <span class="top_title"><img src="/images/report/consult/SubContents_Tit_01.gif" width="370" height="42" alt="지재권상담 일지" /></span> <span class="top_navi">HOME > 업무보고 > 지재권상담 일지</span></dd>
        <dd class="Right_Contents_Search"><img src="/images/report/consult/SubContents_Tit_CenterChoice.gif" width="81" height="21" alt="센터선택" /></dd>
         <dd class="Right_Contents_SearchOption">
         <s:if test="%{#authCode == 'ADMIN'}">	<%// 통합 관리자인 경우, %>
        	<s:include value="/view/include/common/deskcode/deskcode_total.jsp"/>
   		</s:if>
   		<s:if test="%{#authCode != 'ADMIN'}"> <%// 통합 관리자가 아닌 경우 %>
   			<s:if test="%{#authCode == 'ADMIN_ORG'}"> <%// 소속 관리자인 경우 %>
   				<s:if test="%{#orgCode == 'KIPRA'}"> <%// 소속 관리자중에서 소속이 KIPRA인 경우 %>
   					<s:include value="/view/include/common/deskcode/deskcode_kipra.jsp"/>
   				</s:if>
   				<s:if test="%{#orgCode == 'KOTRA'}"> <%// 소속 관리자중에서 소속이 KOTRA인 경우 %>
   					<s:include value="/view/include/common/deskcode/deskcode_kotra.jsp"/>
   				</s:if>
   			</s:if>
   			<s:if test="%{#authCode == 'CONSULTANT'}"> <%// 컨설턴트인 경우 %>
   				<s:include value="/view/include/common/deskcode/deskcode_consultant.jsp"/>
   			</s:if>
   			<s:set name="dCode" value="%{deskCode}"/>
   		</s:if>
        </dd>
        <dd class="Right_Contents_Notice">총 <span class="TEXT_Red_Bold"><s:property value="%{#totalCount}"/></span>건의 지재권상담 일지 정보 검색됨</dd>
        <dd class="Right_Contents_NoticeBtn"><img src="/images/notice/btn_ExelDown.gif" id="btn_excel_download" width="114" height="26" alt="엑셀다운로드" style="cursor:pointer"/></dd>
        <dd style="width:50px;position:relative;;margin:5px;">
        	<s:select name="year" id="year" list="#{'':'전체','2013':'2013','2012':'2012','2011':'2011'}"/>&nbsp;
        </dd>
        <dd style="width:70px;position:relative;;margin:5px;">
        	<s:select name="searchOption" id="searchOption" list="#{'localName':'업체명'}"/>&nbsp;
        </dd>
        <dd style="width:120px;position:relative;;margin:5px;">
        	<input type="text" name="searchKeyword" id="searchKeyword" value="<s:property value="searchKeyword"/>" style="width:110px;" maxlength="10"/>&nbsp;
        </dd>
        <dd style="width:325px;position:relative;margin:5px;">
        	<img src="/images/report/apply/btn_search.gif" width="47" height="22" alt="검색" id="btn_consult_search" style="cursor:pointer;"/>
        </dd>
        <dd style="text-align:right;position:relative;margin:5px;">
    		<label for="state">정렬 : </label>
        	<s:select name="order" id="order" list="#{'consultingDate':'상담일▼', 'consultingDate2':'상담일▲','companyName':'업체명','consultingTypeCode':'상담분야1','iprCode':'상담분야2' }" />
    	</dd>
</form>
        <dd class="Center_Top_contents">
          <div id="LIst_Zone">
            <dl>
              <dd>
                <table cellspacing="0" border="1" summary="글목록" class="Listboard">
                  <caption>글목록</caption>
                  <colgroup><col width="30"><col width="1"><col width="130"><col width="1"><col width="73"><col width="1"><col width="73"><col width="1"><col width="60"></colgroup>
                  <thead>
                    <tr>
                      <th scope="col">번호</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">업체명</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>                      
                      <th scope="col">상담분야1</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">상담분야2</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">상담일</th>
                    </tr>
                  </thead>
                
                  <tbody>
                  	<s:if test="consultList.size == 0">
			     		<tr>
							<td colspan="13" style="text-align: center">등록된 기업이 없습니다.</td>
						</tr>
					</s:if>
					<s:else>
						<s:iterator value="consultList" status="stat">
		                    <tr>
		                      <td><s:property value="(#totalCount + 1 - ((pageInfoDataMap.pageNumber - 1) * pageInfoDataMap.countPerPage)) - (#stat.count)"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit">
		                      	<a href="/consult/consultDetail.desk?consultingSeq=<s:property value="ConsultingSeq"/>&deskCode=${deskCode}">
		                      		<c:if test="${companyName == null}"><s:property value="headName"/></c:if>
		                      		<c:if test="${companyName != null}">
		                      			<c:if test="${companyName == ''}"><s:property value="headName"/></c:if>
		                      			<c:if test="${companyName != ''}"><s:property value="companyName"/></c:if>
		                      		</c:if>
		                      	</a>
		                      </td>                      
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td><s:property value="consultingTypeCode"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td><s:property value="iprCode"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td><s:property value="consultingDate"/></td>
		                    </tr> 
		             	 </s:iterator>
                   </s:else>
                  </tbody>
                  <!-- 리스트 부분 -->
                </table>
              </dd>
               
            </dl> 
            <dl class="List_Page_area"><!-- 리스트 페이징 부분 -->
			    <dd class="page_area">
			      <div class="paginate">
			      	<s:if test="pageInfoDataMap.startPage > pageInfoDataMap.pagePerBlock">
						<s:a href="%{listURLPrev}" cssClass="pre">이전페이지</s:a>
					</s:if> 
			      	<c:forEach var="pageNum" begin="${pageInfoDataMap.startPage}" end="${pageInfoDataMap.endPage}">
						<c:choose>
							<c:when test="${pageNum != 0 && pageNum == pageInfoDataMap.pageNumber}">
								${pageNum}
							</c:when>
							<c:when test="${pageNum == 0 }">
							
							</c:when>
							<c:otherwise>
								<a href="/consult/consultList.desk?pageNumber=${pageNum}&deskCode=${deskCode}&order=${order }&searchKeyword=${searchKeyword }&searchOption=${searchOption }"> [${pageNum}] </a>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			      	<s:if test="pageInfoDataMap.endPage < pageInfoDataMap.totalPageCount">
						<s:a href="%{listURLNext}" cssClass="next">다음페이지 </s:a>
					</s:if>				
				</div>
			    </dd>
			</dl><!-- 리스트 페이징 부분 -->
            <dl class="List_Btn_area"><!-- 버튼 부분 -->
             <dd class="Left_Zone"><a href="/consult/consultList.desk"><img src="/images/notice/btn_list.gif" alt="목록" width="52" height="26" border="0" /></a></dd>
              <s:if test="#orgCode != 'KIPO'">
              	<s:if test="#session.deskCode == #dCode">
             		<dd class="Right_Zone"><a href="/consult/consultForm.desk"><img src="/images/report/consult/btn_write.gif" width="113" height="26" alt="상담일지 등록" border="0" /></a></dd>
              	</s:if>
              	<s:if test="#authCode == 'ADMIN_ORG'">
              		<dd class="Right_Zone"><a href="/consult/consultForm.desk"><img src="/images/report/consult/btn_write.gif" width="113" height="26" alt="상담일지 등록" border="0" /></a></dd>
              	</s:if>
              	<s:if test="#authCode == 'ADMIN'">
              		<dd class="Right_Zone"><a href="/consult/consultForm.desk"><img src="/images/report/consult/btn_write.gif" width="113" height="26" alt="상담일지 등록" border="0" /></a></dd>
              	</s:if>
              </s:if>
            </dl><!-- 버튼 부분 -->          
          </div>
        </dd>
      </dl>
      <!-- 오른쪽 내용 끝 --> 
    </div>
  </div>
  <!-- center 나누어 지는 부분 끝 --> 
</div>